/*    */ package cc.s2m.web.s2mBlog.freemarker;
/*    */ 
/*    */ import cc.s2m.web.s2mBlog.pojo.SysConfig;
/*    */ import cc.s2m.web.s2mBlog.service.ISysConfig;
/*    */ import freemarker.template.SimpleScalar;
/*    */ import freemarker.template.TemplateMethodModelEx;
/*    */ import freemarker.template.TemplateModelException;
/*    */ import java.util.List;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ 
/*    */ public class SysconfigExt
/*    */   implements TemplateMethodModelEx
/*    */ {
/*    */ 
/*    */   @Autowired
/*    */   private ISysConfig sysConfigService;
/*    */ 
/*    */   public Object exec(List arguments)
/*    */     throws TemplateModelException
/*    */   {
/* 20 */     String code = ((SimpleScalar)arguments.get(0)).getAsString();
/* 21 */     SysConfig bean = this.sysConfigService.getByCode(code);
/* 22 */     if (bean == null) {
/* 23 */       return new SysConfig();
/*    */     }
/* 25 */     return bean;
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\s2mBlog.zip
 * Qualified Name:     s2mBlog-3.0.0.WEB-INF.classes.cc.s2m.web.s2mBlog.freemarker.SysconfigExt
 * JD-Core Version:    0.6.1
 */